var arr = new Array(72, 54, 59, 30, 31, 78, 2, 77, 82, 72);
var tmp;
for (var i = 0; i < arr.length-1; i++) {
	// tmp = 
	for(var j = i+1; j < arr.length; j++) {
		if (arr[i] > arr[j]) {
			tmp = arr[i];
			arr[i] = arr[j];
			arr[j] = tmp;
		}
	}
	print(arr.toString());
}